package com.zxc.csms.util;

import java.util.Locale;
import java.util.ResourceBundle;

import com.zxc.csms.common.MessageType;

public class I18NTool {
	/**
	 * 根据key获取消息信息
	 * 
	 * @param key
	 * @return
	 */
	public static String getMessageByType(String key, MessageType messageType) {
		Locale locale = Locale.getDefault();
		ResourceBundle bundle = ResourceBundle.getBundle("i18n/" + messageType,
				locale);
		if (bundle.containsKey(key)) {
			String message = bundle.getString(key);
			return message;
		} else {
			return key;
		}

	}
}
